<?php
	if(!isset($_REQUEST['ajax'])){ $_REQUEST['ajax'] = "";}
	if($_REQUEST['ajax']!=true) include 'header.tpl.php';
	include 'usercp_panel.tpl.php';
?>
	<div class="row">
		<div class="col-lg-12">
			<div class="panel">
				<div class="panel-heading">
					<div class="panel-title"><?php echo $this->language['mail_outbox'];?></div>
				</div>
				<div class="panel-body">
					<table class="table table-fixed table-hover table-condensed">
						<thead>
							<tr>
								<th width="25px"><input type="checkbox" id="checkAll" onClick="checkAllMsg();" /></th>
								<th>Tiêu đề</th>
								<th>Nội dung</th>
								<th width="130px">Thời gian</th>
								<th width="110px">Người nhận</th>
							</tr>
						</thead>
						<tbody>
							<?php 
							$STT = 0;
							foreach($this->msg as $msg){$STT++; ?>
								<tr style="border-bottom:1px solid #d5d4d4;">
									<td><input type="checkbox" id="msg<?php echo $STT;?>" value="<?php echo $msg['msgId'];?>" /></td>
									<td><a href='#usercp_msgr/id=<?php echo $msg['msgId'];?>'><?php echo $msg['msgTitle'];?></a></td>
									<td><?php echo substr(str_replace(array("\t","\n","\r"),array(""),strip_tags($msg['msgContent'])),0,100);?> ...</td>
									<td><?php echo date("H:i:s d/m/Y",$msg['msgTime']);?></td>
									<td><a href='#user_view/uId=<?php echo $msg['msgReceiver'];?>'><?php echo $_SESSION['user_data'][$msg['msgReceiver']]['fullname'];?></a></td>
								</tr>
							<?php } ?>
						</tbody>
						<?php echo $this->tfoot;?>
					</table>
				</div>
			</div>
		</div>
	</div>
<?php if(isset($this->breadcrumb) && isset($this->title_header)):?>
	<script type="text/javascript">
		$(function() {
			$("#title-header").text('<?php echo $this->title_header;?>');
			$("#breadcrumb").html('<?php echo build_breadcrumb($this->breadcrumb);?>');
		});
	</script>
<?php endif;?>
<?php
	if($_REQUEST['ajax']!=true) include 'footer.tpl.php';
?>